<template>
    <div class="">
        <el-dialog
                :title="title"
                :visible.sync="dialogFormVisible"
                width="45%"
                :close-on-click-modal="false"
                @close="close"
        >
          <div>
            <el-form ref="form" :model="form" label-width="120px">
              <div class="flex-bet flex-y-top">
                <div class="bflex-4">
                  <div class="shuju_title">
                    <div class="shuju_title_text">
                      <span>订单信息</span>
                    </div>
                  </div>
                  <div class="formBox">
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">订单类型：</div>
                      <div>
                        <span><el-tag size="mini" type="success">排队取号</el-tag></span>
                      </div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">订单渠道：</div>
                      <div>
                        <span v-if="orderDetail.origin=='1'"><el-tag size="mini" type="success">微信小程序</el-tag></span>
                        <span v-if="orderDetail.origin=='2'"><el-tag size="mini" type="success">微信公众号</el-tag></span>
                        <span v-if="orderDetail.origin=='3'"><el-tag size="mini" type="success">支付宝小程序</el-tag></span>
                        <span v-if="orderDetail.origin=='4'"><el-tag size="mini" type="success">百度小程序</el-tag></span>
                        <span v-if="orderDetail.origin=='5'"><el-tag size="mini" type="success">H5</el-tag></span>
                        <span v-if="orderDetail.origin=='6'"><el-tag size="mini" type="success">PC</el-tag></span>
                        <span v-if="orderDetail.origin=='7'"><el-tag size="mini" type="success">头条小程序</el-tag></span>
                      </div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">用户信息：</div>
                      <div>{{ orderDetail.userName }}（UID：{{ orderDetail.userId }}）</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">取号时间：</div>
                      <div>{{ orderDetail.createdAt }}</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">操作时间：</div>
                      <div>{{ orderDetail.changeAt }}</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">叫号状态：</div>
                      <div class="flex flex-center">
                        <div>
                          <el-tag class="tag3" v-show="orderDetail.state==1" size="mini">待叫号</el-tag>
                          <el-tag class="tag4" type="success" v-show="orderDetail.state==2" size="mini">已入座</el-tag>
                          <el-tag class="tag2" type="danger" v-show="orderDetail.state==3" size="mini">已过号</el-tag>
                          <el-tag class="tag1" type="info" v-show="orderDetail.state==4" size="mini">已取消</el-tag>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="bflex-6 mar_l20">
                  <div class="shuju_title">
                    <div class="shuju_title_text">
                      <span>取号详情</span>
                    </div>
                  </div>
                  <div class="formBox">
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">取餐号：{{ orderDetail.code }}</div>
                      <div class=""></div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">就餐人数：{{ orderDetail.people }}</div>
                      <div class=""></div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">餐桌类型：{{ orderDetail.name }}</div>
                      <div class=""></div>
                    </div>
                  </div>
                </div>
              </div>
            </el-form>
          </div>
            <div slot="footer" class="dialog-footer">
                <el-button size="medium" @click="close">取 消</el-button>
                <el-button size="medium" type="primary" @click="save">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import { saveType ,getSaveType} from "@/api/plug";
    export default {
        name: "goodlistedit",
        created() {
        },
        data() {
            return {
                form: {
                    id:'',
                    sort: "1",
                    name: "",
                    min: "",
                    max: "",
                    minute: "",
                },
                orderDetail: {},
                title: "",
                type: "",
                dialogFormVisible: false,
            }
        },
        components: {
        },
        methods: {
            async showEdit(row) {
                if (!row) {
                    this.title = "添加";
                } else {
                    this.title = "订单详情";
                  // const { data } = await getSaveType({id:row.id});
                  // this.form = data
                    this.orderDetail = Object.assign({}, row);
                }
                this.dialogFormVisible = true;
            },
            close() {
                // this.$refs["form"].resetFields();
                // this.form = this.$options.data().form;
                this.dialogFormVisible = false;
            },
            setStoreId(storeId){
              this.form.storeId = storeId
            },
            save() {
              this.dialogFormVisible = false;
                // this.$refs["form"].validate(async (valid) => {
                //     if (valid) {
                //         const { msg } = await saveType(this.form);
                //         this.$baseMessage(msg, "success");
                //         this.$emit("fetchData");
                //         this.close();
                //     } else {
                //         return false;
                //     }
                // });
            },
        }
    };
</script>
<style>
  .zdyinput .el-input__inner{
    width: 180px;
  }
</style>
